package com.jhw.ymcc.fallback;

import com.jhw.ymcc.exception.GlobalErrorCode;
import com.jhw.ymcc.feign.CourseService;
import com.jhw.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author jhw
 * @create 2022/10/15
 */
@Component
public class CourseServiceFallbackFactory implements FallbackFactory<CourseService> {
    @Override
    public CourseService create(Throwable cause) {
        return new CourseService() {
            @Override
            public JSONResult info(String courseIds) {
                return JSONResult.error();
            }

            @Override
            public JSONResult get(Long id) {
                return JSONResult.error();
            }
        };
    }
}
